reverse the string only characters not affecting the special characters